package com.kcral.javase.ch.properties;

/**
 * @TODO
 * @Author xu
 * 2025/3/3
 */
public class Goods {
    private String name;          // 货物名称
    private double price;         // 货物价格
    private String description;    // 货物描述

    public Goods(String name, double price, String description) {
        this.name = name;
        this.price = price;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public double getPrice() {
        return price;
    }

    public String getDescription() {
        return description;
    }

    // 获取货物信息
    public String showDetails() {
        return String.format("货物名称: %s\n价格: %.2f\n描述: %s", name, price, description);
    }
}
